package version3;

import java.util.Comparator;

public class ComparatorByStringLength implements Comparator<String > {
    @Override
    public int compare(String o1, String o2) {
        String str1 = (String)o1;
        String str2 = (String)o2;
        int temp = str1.length() - str2.length();
        return temp == 0 ? str1.compareTo(str2) : temp;
    }
}
